<template>
        <div>
            <el-table :data="ftab" style="width: 100%" @selection-change="xuan" ref="selection">
                <el-table-column type="selection" width="55" />
                <el-table-column prop="stuNo" label="学号" width="180" />
                <el-table-column prop="stuName" label="学生姓名" width="180" />
                <el-table-column prop="className" label="班级" />
                <el-table-column prop="collegeName" label="学院名称" />
                <el-table-column prop="expertiseName" label="专业" />
                <el-table-column prop="origin" label="市场部" />
                <el-table-column prop="status" label="学生状态" />
                <el-table-column fixed="right" label="操作" min-width="180">
                    <template #default="scope">
                        <el-button type="primary" size="small" @click="look(scope.row)">
                            查看
                        </el-button>
                        <el-button type="primary" size="small" @click="edit(scope.row)">编辑</el-button>
    
                        <!-- 删除确认框 -->
                        <el-popconfirm title="您确定删除吗?" @confirm="del(scope.row)" confirm-button-text="确定"
                            cancel-button-text="取消">
                            <template #reference>
                                <el-button type="primary" size="small">删除</el-button>
                            </template>
                        </el-popconfirm>
                        <!-- <el-button link type="primary" size="small" @click="del(scope.row)">删除</el-button> -->
                    </template>
                </el-table-column>
            </el-table>    
        </div>
</template>
    
<script setup lang='ts'>
 import { ref, reactive, onMounted, computed,defineProps,defineEmits } from 'vue'
 import { getstudents, getaddstudents, getdel, getedit } from '../request/api';
  import { ElMessage, ElMessageBox } from 'element-plus'
//  const props=defineProps({ftab:Array })
 let {ftab}=defineProps(['ftab' ])

 const emit=defineEmits(['deltab','delall','look','edit'])
//  删除
const del=(row:any)=>{
  emit('deltab',row.id)
}

// 查看
const look=(row:any)=>{
  emit('look',row)
}
// 编辑
const edit=(row:any)=>{
  emit('edit',row)
}

     // 多选
     const selection = ref(false)
    const delData = ref(false)

     // 选择
     const xuan = (val: any) => {
        console.log(val,'2222')
        let ids = val.map((item: any, index: number) => {
            return item.id
        })
        delData.value = ids
        console.log(delData.value,'tabl777777')
        emit('delall',delData.value)
    }

// 批量删除


    
</script>
    
<style scoped lang='scss'>
    
</style>